package com.tc.juc.pack08;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Auther: tianchao
 * @Date: 2021/10/8 23:15
 * @Description:
 */
@Slf4j
public class TestNewSingleThreadExecutor {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        executorService.execute(()->{
            log.info("a");
        });
        executorService.execute(()->{
            log.info("b");
            int i = 1/0;
        });
        executorService.execute(()->{
            log.info("c");
        });
    }
}
